<template>
	<view>
		<view class="imgbox">
			<image :src="avatar"></image>
		</view>
		<view class="namebox">{{username}}</view>
		<view class="phonebox" @click="call">
			<image class="picon" src="../../static/usercenter/phone-icon.png"></image>
			<text class="ptext">联系电话</text>
			<text class="pnumber">{{mobile}}</text>
			<image class="prighticon" src="../../static/usercenter/icon_zk.png"></image>
		</view>
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				username:'',
				avatar:'',
				mobile:''
			}
		},
		onLoad(){
			
		},
		
		onShow(){
			this.myRefer();
		},
		methods: {
			pageTo(url){
				this.$util.$navigateTo(url);
			},
			
			call(){
				uni.makePhoneCall({
				    phoneNumber: this.mobile
				});
			},
			
			myRefer(){
				let param = {
					
				}
				let that = this;
				this.$api.myRecommend(param).then(res => {
					
					console.info(res);
					if(res.code == 1){
					
						that.avatar = res.data.avatar;
						that.mobile = res.data.mobile;
						that.username = res.data.username;
			
					}
					console.info(res)
				})
			}
		}
	}
</script>

<style lang="scss">
	.imgbox{
		margin: 49rpx auto;
		text-align: center;
		image{
			width: 128rpx;
			height: 128rpx;
		}
	}
	.namebox{
		font-size:36rpx;
		color: #333333;
		text-align: center;
	}
	.phonebox{
		margin:60rpx 40rpx;
		border-bottom: 1rpx solid #EBEBEB;
		display: flex;
		padding: 17rpx 0;
		.picon{
			width: 50rpx;
			height: 50rpx;
		}
		.ptext{
			flex: auto;
			font-size: 28rpx;
			color: #333333;
			margin-left: 10rpx;
			margin-top: 8rpx;
		}
		.pnumber{
			font-size: 28rpx;
			color: #666666;
		}
		.prighticon{
			width:36rpx;
			height: 36rpx;
			margin-left: 14rpx;
		}
	}
</style>
